package com.TestDemo.Test2;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/11/03/10:20
 * @Description:
 * @Target: 字符串转字符数组
 */
@SuppressWarnings("ALL")
public class StringTOArray {
    public static void main(String[] args) {

        String[] ss = new String[]{"sad","fwrwqw","45116","fqsadas"};


        SAOut(ss);


        /*
        String ss = "sadsadasdasd";

        char[] chars = STA(ss);

        for (char aChar : chars) {
            System.out.print(aChar+" ");
        }
*/


    }





    // 字符串数组转字符
    public static void SAOut(String[] ss){
        int length = ss.length;
        int i = 0;
        while (i<length){
            char[] tmpChar = STA(ss[i++]);
            CharOut(tmpChar);
            System.out.println();
        }
    }




    // 单个字符串转字符
    public static char[] STA(String ss){
        char[] chars = ss.toCharArray();
        return chars;
    }



    // 打印器
    public static void CharOut(char[] chars){
        for (char aChar : chars) {
            System.out.print(aChar+" ");
        }
    }

}
